import request from '@/utils/request.js';

// 获取商品分类数据
export const getGoodCateList = (params) => {
  return request({
    method: 'GET',
    url: 'categories',
    params
  });
};

// 添加分类
export const addCategories = (data) => {
  return request({
    method: 'POST',
    url: 'categories',
    data
  });
};

// 根据id查询分类
export const editCate = (id, data) => {
  return request({
    method: 'PUT',
    url: `categories/${id}`,
    data
  });
};

// 根据id删除分类
export const deleteCate = (id) => {
  return request({
    method: 'DELETE',
    url: `categories/${id}`
  });
};

